home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_13_01
/
allison
/
copy1.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1994-11-02
|
272 b
|
16 lines
LISTING 4 - A Function that copies a file via character I/O
/* copy1.c */
#include <stdio.h>
int copy(FILE *dest, FILE *source)
{
int c;
while ((c = getc(source)) != EOF)
if (putc(c,dest) == EOF)
return EOF;
return 0;
}